// 继承方式
#include <iostream>
using namespace std;
class Father {
public:
    int m_a;
protected:
    int m_b;
private:  // 父类的私有成员子类不可继承
    int m_c;
};
class Son1: public Father{
public:
    void func() {
        m_a = 10;   // 子类中为公共
        m_b = 20;   // 子类中为保护
        // m_c = 30;
    }
};
class Son2: protected Father {
public:
    void func() {
        m_a = 10;   // 子类中为保护
        m_b = 20;   // 子类中为保护
        // m_c = 30;
    }
};
class Son3: private Father {
public:
    void func() {
        m_a = 10;   // 子类中为私有
        m_b = 20;   // 子类中为私有
        // m_c = 30;
    }
};
void test1() {
    Son1 s1;
    cout << s1.m_a << endl;
    // cout << s2.m_b << endl;  // 非法访问
}
int main(void) {

    return 0;
}